package com.signway.javaui.slice.component;

import com.signway.javaui.ResourceTable;
import com.signway.javaui.base.BaseAbilitySlice;
import com.signway.javaui.component.ControlBar;
import com.signway.javaui.utils.SwLog;
import ohos.aafwk.content.Intent;

public class CustomComponent extends BaseAbilitySlice {

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_slice_component_custom);

        ControlBar controlBar = (ControlBar) findComponentById(ResourceTable.Id_control_bar);
        controlBar.setListener(progress -> {
            SwLog.info("progress = " + progress);
        });
        controlBar.setProgress(controlBar.getMax() / 2);
    }
}
